package com.lesson6.builder.improve;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/8/28 21:52
 */
public class HouseDirector
{
    HouseBuilder houseBuilder = null;

    public HouseDirector(HouseBuilder houseBuilder)
    {
        this.houseBuilder = houseBuilder;
    }

    public void setHouseBuilder(HouseBuilder houseBuilder)
    {
        this.houseBuilder = houseBuilder;
    }

    //指挥者会动态的指定制作流程
    public House constructHouse(){
        houseBuilder.buildBasic();
        houseBuilder.buildWalls();
        houseBuilder.roofed();
        return houseBuilder.buildHouse();
    }
}
